<template>
    <div class="report-container">
        <div class="search-content">
            <input class="search-input" v-model="search" placeholder="请输入企业名称/法人姓名" />
            <div class="btn" @click="searchHander">
                <img src="../../assets/images/DueDiligence/search.png" alt="">
                <span>搜索</span>
            </div>
        </div>
        <div class="change-content">
            <div class="list">
                <h3>报告类型：</h3>
                <div @click="onChange('类型：' + item)" v-for="(item, index) in reportType" :key="index" class="item">{{
                    item
                }}
                </div>
            </div>
            <div class="list">
                <h3>报告状态：</h3>
                <div @click="onChange('状态：' + item)" v-for="(item, index) in reportState" :key="index" class="item">{{
                    item
                }}
                </div>
            </div>
        </div>
        <div class="on-change">
            <h3>您已选择：</h3>
            <div class="item" v-for="(item, index) in changeList" :key="index">{{ item }}<span
                    @click="onDelete(item)">×</span></div>
        </div>
        <div class="result-content">
            <div class="item" v-for="(item, index) in list" :key="index">
                <div class="title">{{ item.title }}</div>
                <div class="company">
                    <h3>企业名称：</h3>
                    <div>{{ item.companyName }}</div>
                </div>
                <div class="person">
                    <h3>法人：</h3>
                    <div>{{ item.person }}</div>
                </div>
                <div class="date">
                    <h3>查询时间：</h3>
                    <div>{{ item.date }}</div>
                </div>
                <div class="status">
                    <h3>状态：</h3>
                    <div v-if="item.status">已生成</div>
                    <div v-else>生成中</div>
                </div>
                <div class="btns">
                    <span>编辑</span>
                    <span>删除</span>
                </div>
            </div>
        </div>
        <el-pagination class="pagination" background layout="prev, pager, next" :total="1000" />
    </div>
</template>

<script lang="ts" setup>
import { ref } from "vue"

const search = ref("")
const changeList = ref(["类型：招商准入", "状态：不限"])

const reportType = ["不限", "招商准入", "经营分析", "用电分析", "供应链分析", "行业分析", "企业竞争力分析", "产业市场分析", "综合分析"]
const reportState = ["不限", "已生成", "生成中"]

const list = [
    {
        id: 1,
        title: "企业准入分析报告",
        companyName: "北京中研硕福科技有限公司",
        person: "陈磊滨",
        date: "2024-3-27 12:00",
        status: true,
    },
    {
        id: 2,
        title: "企业准入分析报告",
        companyName: "北京中研硕福科技有限公司",
        person: "陈磊滨",
        date: "2024-3-27 12:00",
        status: true,
    },
    {
        id: 3,
        title: "企业准入分析报告",
        companyName: "北京中研硕福科技有限公司",
        person: "陈磊滨",
        date: "2024-3-27 12:00",
        status: false,
    },
    {
        id: 4,
        title: "企业准入分析报告",
        companyName: "北京中研硕福科技有限公司",
        person: "陈磊滨",
        date: "2024-3-27 12:00",
        status: true,
    }
]

const searchHander = () => {

}

const onChange = (item) => {
    changeList.value.push(item)
}

const onDelete = (item) => {
    console.log(item);
}

</script>

<style lang="less" scoped>
.search-content {
    width: 80%;
    display: flex;
    margin: 20px auto;

    .search-input {
        flex: 1;
        height: 70px;
        border: 1px solid #CECECE;
        outline: none !important;
        padding-left: 20px;
        box-sizing: border-box;
        font-size: 18px;
        border-top-left-radius: 10px;
        border-bottom-left-radius: 10px;
        border: 2px solid #536EF7;
    }

    .btn {
        width: 150px;
        height: 70px;
        background-color: #536EF7;
        display: flex;
        align-items: center;
        justify-content: center;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;

        img {
            width: 25px;
            height: 25px;
            margin-right: 10px;
        }

        span {
            font-weight: bold;
            font-size: 20px;
            color: #FFFFFF;
        }
    }
}

.change-content {
    padding: 10px 40px;
    padding-top: 0;

    .list {
        display: flex;
        margin: 10px 0;
        flex-wrap: wrap;

        h3 {
            font-weight: 400;
            font-size: 16px;
            color: #373737;
        }

        .item {
            float: left;
            font-weight: 400;
            font-size: 16px;
            color: #373737;
            margin: 0 10px;
            cursor: pointer;
        }
    }
}

.on-change {
    display: flex;
    flex-wrap: wrap;
    margin: 10px 0;
    padding: 40px;
    padding-top: 0;
    align-items: center;

    h3 {
        font-weight: 500;
        font-size: 18px;
        color: #212121;
    }

    .item {
        background: #ECECEC;
        margin: 0 10px;
        padding: 5px 10px;

        span {
            margin-left: 20px;
            cursor: pointer;
        }
    }
}

.result-content {
    width: 95%;
    box-shadow: 0 0 15px rgba(100, 100, 100, .2);
    margin: 10px auto;
    padding: 40px;
    box-sizing: border-box;

    .item {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 30px 0;

        .title {
            flex: 2;
            font-weight: 500;
            font-size: 15px;
            color: #333333;
        }

        .company {
            flex: 2;

            h3 {
                font-size: 15px;
                color: #333333;
            }

            div {
                font-size: 15px;
                color: #333333;
            }
        }

        .person {
            flex: 1;

            h3 {
                font-size: 15px;
                color: #333333;
            }

            div {
                font-size: 15px;
                color: #333333;
            }
        }

        .date {
            flex: 2;

            h3 {
                font-size: 15px;
                color: #333333;
            }

            div {
                font-size: 15px;
                color: #333333;
            }
        }

        .status {
            flex: 1;

            h3 {
                font-size: 15px;
                color: #333333;
            }

            div {
                font-size: 15px;
                color: #333333;
            }
        }

        .btns {
            flex: 1;

            span {
                margin: 0 10px;
                cursor: pointer;
                color: #0B70CF;
            }
        }
    }
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    width: 80%;
    height: 80px;
    line-height: 80px;
    margin: 0 auto;
}
</style>